package com.odata.springboot.starter.odata.odata.sql.filterMethod;

import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @author chenYX
 * @date 2021/6/29 14:30
 * @description
 */
public class FilterMethodHandlerFactory {
    public static Map<String, FilterMethodHandler> filterMethodHandlerMap = new HashMap<>();

    public static void putHandler(String handlerKey,FilterMethodHandler filterMethodHandler){
        filterMethodHandlerMap.put(handlerKey,filterMethodHandler);
    }

    public static FilterMethodHandler getHandler(String handlerKey){
        if (StringUtils.isBlank(handlerKey)){
            return null;
        }
        return filterMethodHandlerMap.get(handlerKey);
    }
}
